package com.ynny.student.register;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Register {
    public static void main(String[] args) {
        // 使用 ClassPathXmlApplicationContext 加载 spring.xml 配置文件
        ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
        User user = (User) context.getBean("user");
        System.out.println(user);
        ((ClassPathXmlApplicationContext)context).close();
    }
}
